<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Login</title>
    <link
      rel="stylesheet"
      href="./font-awesome-4.7.0/css/font-awesome.min.css"
    />
    <link rel="stylesheet" href="./index.css" />
  </head>
  <body>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#0099ff" fill-opacity="1" d="M0,160L48,149.3C96,139,192,117,288,138.7C384,160,480,224,576,240C672,256,768,224,864,218.7C960,213,1056,235,1152,234.7C1248,235,1344,213,1392,202.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg><div class="user">
      <i class="fa fa-user"></i>
      <div class="head">account login</div>
    </div>
    <div class="container">
      <div class="box login">
        <div class="form-content">
          <div class="avtar">
            <div class="pic"><img src="./img/1.jpg" alt="" /></div>
          </div>
          <h1>Welcome back</h1>
          <form action="#" class="form">
            <div>
              <i class="fa fa-user-o"></i>
              <input type="text" placeholder="username" />
            </div>
            <div>
              <i class="fa fa-key"></i>
              <input type="password" placeholder="password" />
            </div>
            <div class="btn">
              <button>login</button>
            </div>
          </form>
          <p class="tips">
            Don't have an account ? <span class="signupbtn">signup</span>
          </p>
        </div>
      </div>
      <div class="box signup">
        <div class="form-content">
          <div class="avtar">
            <div class="pic"><img src="./img/2.jpg" alt="" /></div>
          </div>
          <h1>Let's get started</h1>
          <form action="#" class="form">
            <div>
              <i class="fa fa-user-o"></i>
              <input type="text" placeholder="username" />
            </div>
            <div>
              <i class="fa fa-envelope-o"></i>
              <input type="email" placeholder="email" />
            </div>
            <div>
              <i class="fa fa-key"></i>
              <input type="password" placeholder="password" />
            </div>
            <div class="btn">
              <button>signup</button>
            </div>
          </form>
          <p class="tips">
            Already hace an account ? <span class="loginbtn">login</span>
          </p>
        </div>
      </div>
    </div>
  </body>
  <script>
    let login = document.querySelector(".login");
    let signup = document.querySelector(".signup");

    let loginbtn = document.querySelector(".loginbtn");
    let signupbtn = document.querySelector(".signupbtn");

    let user = document.querySelector(".head");

    signupbtn.addEventListener("click", () => {
      login.style.transform = "rotateY(180deg)";
      signup.style.transform = "rotateY(0deg)";

      user.innerHTML="create account";
    });

    signup.addEventListener("click", () => {
      login.style.transform = "rotateY(0deg)";
      signup.style.transform = "rotateY(-180deg)";

      user.innerHTML="account login";
    });
  </script>
</html>
